home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / MacOS 8 Resources / Developer Tools / Mac OS 8 Interfaces & Libraries / Interfaces / CIncludes / PPCToolbox.h < prev    next >
C/C++ Source or Header  |  1996-05-01  |  20KB  |  554 lines

  1. /*
  2.      File:        PPCToolbox.h
  3.  
  4.      Contains:    Program-Program Communications Toolbox Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Release:    Universal Interfaces 3.0d3 on Copland DR1
  8.  
  9.      Copyright:    © 1984-1996 by Apple Computer, Inc.  All rights reserved.
  10.  
  11.      Bugs?:        If you find a problem with this file, send the file and version
  12.                  information (from above) and the problem description to:
  13.  
  14.                      Internet:    apple.bugs@applelink.apple.com
  15.                      AppleLink:    APPLE.BUGS
  16.  
  17. */
  18. #ifndef __PPCTOOLBOX__
  19. #define __PPCTOOLBOX__
  20.  
  21. #ifndef __APPLETALK__
  22. #include <AppleTalk.h>
  23. #endif
  24. #ifndef __MEMORY__
  25. #include <Memory.h>
  26. #endif
  27. #ifndef __TYPES__
  28. #include <Types.h>
  29. #endif
  30.  
  31. #ifdef __cplusplus
  32. extern "C" {
  33. #endif
  34.  
  35. #if PRAGMA_IMPORT_SUPPORTED
  36. #pragma import on
  37. #endif
  38.  
  39. #if PRAGMA_ALIGN_SUPPORTED
  40. #pragma options align=mac68k
  41. #endif
  42.  
  43. #if FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED
  44. typedef unsigned char PPCServiceType;
  45.  
  46. enum {
  47.     ppcServiceRealTime            = 1
  48. };
  49.  
  50. typedef short PPCLocationKind;
  51.  
  52. enum {
  53.     ppcNoLocation                = 0,                            /* There is no PPCLocName */
  54.     ppcNBPLocation                = 1,                            /* Use AppleTalk NBP      */
  55.     ppcNBPTypeLocation            = 2                                /* Used for specifying a location name type during PPCOpen only */
  56. };
  57.  
  58. typedef short PPCPortKinds;
  59.  
  60. enum {
  61.     ppcByCreatorAndType            = 1,                            /* Port type is specified as colloquial Mac creator and type */
  62.     ppcByString                    = 2                                /* Port type is in pascal string format */
  63. };
  64.  
  65. /* Values returned for request field in PPCInform call */
  66. typedef unsigned char PPCSessionOrigin;
  67.  
  68. enum {
  69.                                                                 /* Values returned for requestType field in PPCInform call */
  70.     ppcLocalOrigin                = 1,                            /* session originated from this machine */
  71.     ppcRemoteOrigin                = 2                                /* session originated from remote machine */
  72. };
  73.  
  74. typedef short PPCPortRefNum;
  75. typedef long PPCSessRefNum;
  76. struct PPCPortRec {
  77.     ScriptCode                         nameScript;                    /* script of name */
  78.     Str32Field                         name;                        /* name of port as seen in browser */
  79.     PPCPortKinds                     portKindSelector;            /* which variant */
  80.     union {
  81.         Str32                             portTypeStr;            /* pascal type string */
  82.         struct {
  83.             OSType                             portCreator;
  84.             OSType                             portType;
  85.         }                                 port;
  86.     }                                 u;
  87. };
  88. typedef struct PPCPortRec PPCPortRec;
  89.  
  90. typedef PPCPortRec *PPCPortPtr;
  91. struct LocationNameRec {
  92.     PPCLocationKind                 locationKindSelector;        /* which variant */
  93.     union {
  94.         EntityName                         nbpEntity;                /* NBP name entity */
  95.         Str32                             nbpType;                /* just the NBP type string, for PPCOpen */
  96.     }                                 u;
  97. };
  98. typedef struct LocationNameRec LocationNameRec;
  99.  
  100. typedef LocationNameRec *LocationNamePtr;
  101. struct PortInfoRec {
  102.     SInt8                             filler1;
  103.     Boolean                         authRequired;
  104.     PPCPortRec                         name;
  105. };
  106. typedef struct PortInfoRec PortInfoRec;
  107.  
  108. typedef PortInfoRec *PortInfoPtr;
  109. typedef PortInfoRec *PortInfoArrayPtr;
  110. typedef union PPCParamBlockRec PPCParamBlockRec;
  111. typedef PPCParamBlockRec *PPCParamBlockPtr;
  112. typedef pascal void (*PPCCompProcPtr)(PPCParamBlockPtr pb);
  113.  
  114. #if GENERATINGCFM
  115. typedef UniversalProcPtr PPCCompUPP;
  116. #else
  117. typedef PPCCompProcPtr PPCCompUPP;
  118. #endif
  119. #define PPCHeader \
  120.      Ptr            qLink;                   /* PPC's Internal Use */\
  121.      unsigned short csCode;                   /* Requested PPC command */\
  122.      unsigned short intUse;                   /* Internal Use */\
  123.      Ptr            intUsePtr;              /* Internal Use */\
  124.      PPCCompUPP     ioCompletion;            /* 12 --> Completion Routine */\
  125.      OSErr           ioResult;                  /* 16 <-- Command Result Code */\
  126.      unsigned long    Reserved[5];             /* Reserved for PPC, Don't use */
  127.  
  128. struct PPCOpenPBRec {
  129.     Ptr                             qLink;                        /* PPC's Internal Use */
  130.     unsigned short                     csCode;                        /* Requested PPC command */
  131.     unsigned short                     intUse;                        /* Internal Use */
  132.     Ptr                             intUsePtr;                    /* Internal Use */
  133.     PPCCompUPP                         ioCompletion;                /* 12 -->    Completion Routine */
  134.     OSErr                             ioResult;                    /* 16 <--     Command Result Code */
  135.     unsigned long                     Reserved[5];                /* Reserved for PPC, Don't use */
  136.     PPCPortRefNum                     portRefNum;                    /* 38 <--   Port Reference */
  137.     long                             filler1;
  138.     PPCServiceType                     serviceType;                /* 44 -->    Bit field describing the requested port service */
  139.     UInt8                             resFlag;                    /* Must be set to 0 */
  140.     PPCPortPtr                         portName;                    /* 46 -->   PortName for PPC */
  141.     LocationNamePtr                 locationName;                /* 50 -->   If NBP Registration is required */
  142.     Boolean                         networkVisible;                /* 54 -->   make this network visible on network */
  143.     Boolean                         nbpRegistered;                /* 55 <--   The given location name was registered on the network */
  144. };
  145. typedef struct PPCOpenPBRec PPCOpenPBRec;
  146.  
  147. typedef PPCOpenPBRec *PPCOpenPBPtr;
  148. struct PPCInformPBRec {
  149.     Ptr                             qLink;                        /* PPC's Internal Use */
  150.     unsigned short                     csCode;                        /* Requested PPC command */
  151.     unsigned short                     intUse;                        /* Internal Use */
  152.     Ptr                             intUsePtr;                    /* Internal Use */
  153.     PPCCompUPP                         ioCompletion;                /* 12 -->    Completion Routine */
  154.     OSErr                             ioResult;                    /* 16 <--     Command Result Code */
  155.     unsigned long                     Reserved[5];                /* Reserved for PPC, Don't use */
  156.     PPCPortRefNum                     portRefNum;                    /* 38 -->   Port Identifier */
  157.     PPCSessRefNum                     sessRefNum;                    /* 40 <--   Session Reference */
  158.     PPCServiceType                     serviceType;                /* 44 <--   Status Flags for type of session, local, remote */
  159.     Boolean                         autoAccept;                    /* 45 -->   if true session will be accepted automatically */
  160.     PPCPortPtr                         portName;                    /* 46 -->   Buffer for Source PPCPortRec */
  161.     LocationNamePtr                 locationName;                /* 50 -->   Buffer for Source LocationNameRec */
  162.     StringPtr                         userName;                    /* 54 -->   Buffer for Soure user's name trying to link. */
  163.     unsigned long                     userData;                    /* 58 <--   value included in PPCStart's userData */
  164.     PPCSessionOrigin                 requestType;                /* 62 <--   Local or Network */
  165.     SInt8                             filler;
  166. };
  167. typedef struct PPCInformPBRec PPCInformPBRec;
  168.  
  169. typedef PPCInformPBRec *PPCInformPBPtr;
  170. struct PPCStartPBRec {
  171.     Ptr                             qLink;                        /* PPC's Internal Use */
  172.     unsigned short                     csCode;                        /* Requested PPC command */
  173.     unsigned short                     intUse;                        /* Internal Use */
  174.     Ptr                             intUsePtr;                    /* Internal Use */
  175.     PPCCompUPP                         ioCompletion;                /* 12 -->    Completion Routine */
  176.     OSErr                             ioResult;                    /* 16 <--     Command Result Code */
  177.     unsigned long                     Reserved[5];                /* Reserved for PPC, Don't use */
  178.     PPCPortRefNum                     portRefNum;                    /* 38 -->   Port Identifier */
  179.     PPCSessRefNum                     sessRefNum;                    /* 40 <--   Session Reference */
  180.     PPCServiceType                     serviceType;                /* 44 <--   Actual service method (realTime) */
  181.     UInt8                             resFlag;                    /* 45 -->   Must be set to 0  */
  182.     PPCPortPtr                         portName;                    /* 46 -->   Destination portName */
  183.     LocationNamePtr                 locationName;                /* 50 -->   NBP or NAS style service location name */
  184.     unsigned long                     rejectInfo;                    /* 54 <--   reason for rejecting the session request */
  185.     unsigned long                     userData;                    /* 58 -->   Copied to destination PPCInform parameter block */
  186.     unsigned long                     userRefNum;                    /* 62 -->   userRefNum (obtained during login process)  */
  187. };
  188. typedef struct PPCStartPBRec PPCStartPBRec;
  189.  
  190. typedef PPCStartPBRec *PPCStartPBPtr;
  191. struct PPCAcceptPBRec {
  192.     Ptr                             qLink;                        /* PPC's Internal Use */
  193.     unsigned short                     csCode;                        /* Requested PPC command */
  194.     unsigned short                     intUse;                        /* Internal Use */
  195.     Ptr                             intUsePtr;                    /* Internal Use */
  196.     PPCCompUPP                         ioCompletion;                /* 12 -->    Completion Routine */
  197.     OSErr                             ioResult;                    /* 16 <--     Command Result Code */
  198.     unsigned long                     Reserved[5];                /* Reserved for PPC, Don't use */
  199.     short                             filler1;
  200.     PPCSessRefNum                     sessRefNum;                    /* 40 -->   Session Reference */
  201. };
  202. typedef struct PPCAcceptPBRec PPCAcceptPBRec;
  203.  
  204. typedef PPCAcceptPBRec *PPCAcceptPBPtr;
  205. struct PPCRejectPBRec {
  206.     Ptr                             qLink;                        /* PPC's Internal Use */
  207.     unsigned short                     csCode;                        /* Requested PPC command */
  208.     unsigned short                     intUse;                        /* Internal Use */
  209.     Ptr                             intUsePtr;                    /* Internal Use */
  210.     PPCCompUPP                         ioCompletion;                /* 12 -->    Completion Routine */
  211.     OSErr                             ioResult;                    /* 16 <--     Command Result Code */
  212.     unsigned long                     Reserved[5];                /* Reserved for PPC, Don't use */
  213.     short                             filler1;
  214.     PPCSessRefNum                     sessRefNum;                    /* 40 -->   Session Reference */
  215.     short                             filler2;
  216.     long                             filler3;
  217.     long                             filler4;
  218.     unsigned long                     rejectInfo;                    /* 54 -->   reason for rejecting the session request  */
  219. };
  220. typedef struct PPCRejectPBRec PPCRejectPBRec;
  221.  
  222. typedef PPCRejectPBRec *PPCRejectPBPtr;
  223. struct PPCWritePBRec {
  224.     Ptr                             qLink;                        /* PPC's Internal Use */
  225.     unsigned short                     csCode;                        /* Requested PPC command */
  226.     unsigned short                     intUse;                        /* Internal Use */
  227.     Ptr                             intUsePtr;                    /* Internal Use */
  228.     PPCCompUPP                         ioCompletion;                /* 12 -->    Completion Routine */
  229.     OSErr                             ioResult;                    /* 16 <--     Command Result Code */
  230.     unsigned long                     Reserved[5];                /* Reserved for PPC, Don't use */
  231.     short                             filler1;
  232.     PPCSessRefNum                     sessRefNum;                    /* 40 -->   Session Reference */
  233.     Size                             bufferLength;                /* 44 -->   Length of the message buffer */
  234.     Size                             actualLength;                /* 48 <--   Actual Length Written */
  235.     Ptr                             bufferPtr;                    /* 52 -->   Pointer to message buffer */
  236.     Boolean                         more;                        /* 56 -->   if more data in this block will be written */
  237.     SInt8                             filler2;
  238.     unsigned long                     userData;                    /* 58 -->   Message block userData Uninterpreted by PPC */
  239.     OSType                             blockCreator;                /* 62 -->   Message block creator Uninterpreted by PPC */
  240.     OSType                             blockType;                    /* 66 -->   Message block type Uninterpreted by PPC */
  241. };
  242. typedef struct PPCWritePBRec PPCWritePBRec;
  243.  
  244. typedef PPCWritePBRec *PPCWritePBPtr;
  245. struct PPCReadPBRec {
  246.     Ptr                             qLink;                        /* PPC's Internal Use */
  247.     unsigned short                     csCode;                        /* Requested PPC command */
  248.     unsigned short                     intUse;                        /* Internal Use */
  249.     Ptr                             intUsePtr;                    /* Internal Use */
  250.     PPCCompUPP                         ioCompletion;                /* 12 -->    Completion Routine */
  251.     OSErr                             ioResult;                    /* 16 <--     Command Result Code */
  252.     unsigned long                     Reserved[5];                /* Reserved for PPC, Don't use */
  253.     short                             filler1;
  254.     PPCSessRefNum                     sessRefNum;                    /* 40 -->   Session Reference */
  255.     Size                             bufferLength;                /* 44 -->   Length of the message buffer */
  256.     Size                             actualLength;                /* 48 <--   Actual length read */
  257.     Ptr                             bufferPtr;                    /* 52 -->   Pointer to message buffer */
  258.     Boolean                         more;                        /* 56 <--   if true more data in this block to be read */
  259.     SInt8                             filler2;
  260.     unsigned long                     userData;                    /* 58 <--   Message block userData Uninterpreted by PPC */
  261.     OSType                             blockCreator;                /* 62 <--   Message block creator Uninterpreted by PPC */
  262.     OSType                             blockType;                    /* 66 <--   Message block type Uninterpreted by PPC */
  263. };
  264. typedef struct PPCReadPBRec PPCReadPBRec;
  265.  
  266. typedef PPCReadPBRec *PPCReadPBPtr;
  267. struct PPCEndPBRec {
  268.     Ptr                             qLink;                        /* PPC's Internal Use */
  269.     unsigned short                     csCode;                        /* Requested PPC command */
  270.     unsigned short                     intUse;                        /* Internal Use */
  271.     Ptr                             intUsePtr;                    /* Internal Use */
  272.     PPCCompUPP                         ioCompletion;                /* 12 -->    Completion Routine */
  273.     OSErr                             ioResult;                    /* 16 <--     Command Result Code */
  274.     unsigned long                     Reserved[5];                /* Reserved for PPC, Don't use */
  275.     short                             filler1;
  276.     PPCSessRefNum                     sessRefNum;                    /* 40 -->   Session Reference */
  277. };
  278. typedef struct PPCEndPBRec PPCEndPBRec;
  279.  
  280. typedef PPCEndPBRec *PPCEndPBPtr;
  281. struct PPCClosePBRec {
  282.     Ptr                             qLink;                        /* PPC's Internal Use */
  283.     unsigned short                     csCode;                        /* Requested PPC command */
  284.     unsigned short                     intUse;                        /* Internal Use */
  285.     Ptr                             intUsePtr;                    /* Internal Use */
  286.     PPCCompUPP                         ioCompletion;                /* 12 -->    Completion Routine */
  287.     OSErr                             ioResult;                    /* 16 <--     Command Result Code */
  288.     unsigned long                     Reserved[5];                /* Reserved for PPC, Don't use */
  289.     PPCPortRefNum                     portRefNum;                    /* 38 -->   Port Identifier */
  290. };
  291. typedef struct PPCClosePBRec PPCClosePBRec;
  292.  
  293. typedef PPCClosePBRec *PPCClosePBPtr;
  294. struct IPCListPortsPBRec {
  295.     Ptr                             qLink;                        /* PPC's Internal Use */
  296.     unsigned short                     csCode;                        /* Requested PPC command */
  297.     unsigned short                     intUse;                        /* Internal Use */
  298.     Ptr                             intUsePtr;                    /* Internal Use */
  299.     PPCCompUPP                         ioCompletion;                /* 12 -->    Completion Routine */
  300.     OSErr                             ioResult;                    /* 16 <--     Command Result Code */
  301.     unsigned long                     Reserved[5];                /* Reserved for PPC, Don't use */
  302.     short                             filler1;
  303.     unsigned short                     startIndex;                    /* 40 -->   Start Index */
  304.     unsigned short                     requestCount;                /* 42 -->   Number of entries to be returned */
  305.     unsigned short                     actualCount;                /* 44 <--   Actual Number of entries to be returned */
  306.     PPCPortPtr                         portName;                    /* 46 -->   PortName Match */
  307.     LocationNamePtr                 locationName;                /* 50 -->   NBP or NAS type name to locate the Port Location */
  308.     PortInfoArrayPtr                 bufferPtr;                    /* 54 -->   Pointer to a buffer requestCount*sizeof(PortInfo) bytes big */
  309. };
  310. typedef struct IPCListPortsPBRec IPCListPortsPBRec;
  311.  
  312. typedef IPCListPortsPBRec *IPCListPortsPBPtr;
  313. union PPCParamBlockRec {
  314.     PPCOpenPBRec                     openParam;
  315.     PPCInformPBRec                     informParam;
  316.     PPCStartPBRec                     startParam;
  317.     PPCAcceptPBRec                     acceptParam;
  318.     PPCRejectPBRec                     rejectParam;
  319.     PPCWritePBRec                     writeParam;
  320.     PPCReadPBRec                     readParam;
  321.     PPCEndPBRec                     endParam;
  322.     PPCClosePBRec                     closeParam;
  323.     IPCListPortsPBRec                 listPortsParam;
  324. };
  325.  
  326. /*  PPC Calling Conventions  */
  327.  
  328. #if GENERATING68K && !GENERATINGCFM
  329. #pragma parameter __D0 PPCInit
  330. #endif
  331. extern pascal OSErr PPCInit(void )
  332.  TWOWORDINLINE(0x7000, 0xA0DD);
  333.  
  334.  
  335. #if GENERATING68K && !GENERATINGCFM
  336. #pragma parameter __D0 PPCOpenSync(__A0)
  337. #endif
  338. extern pascal OSErr PPCOpenSync(PPCOpenPBPtr pb)
  339.  TWOWORDINLINE(0x7001, 0xA0DD);
  340.  
  341.  
  342. #if GENERATING68K && !GENERATINGCFM
  343. #pragma parameter __D0 PPCOpenAsync(__A0)
  344. #endif
  345. extern pascal OSErr PPCOpenAsync(PPCOpenPBPtr pb)
  346.  TWOWORDINLINE(0x7001, 0xA4DD);
  347.  
  348.  
  349. #if GENERATING68K && !GENERATINGCFM
  350. #pragma parameter __D0 PPCInformSync(__A0)
  351. #endif
  352. extern pascal OSErr PPCInformSync(PPCInformPBPtr pb)
  353.  TWOWORDINLINE(0x7003, 0xA0DD);
  354.  
  355.  
  356. #if GENERATING68K && !GENERATINGCFM
  357. #pragma parameter __D0 PPCInformAsync(__A0)
  358. #endif
  359. extern pascal OSErr PPCInformAsync(PPCInformPBPtr pb)
  360.  TWOWORDINLINE(0x7003, 0xA4DD);
  361.  
  362.  
  363. #if GENERATING68K && !GENERATINGCFM
  364. #pragma parameter __D0 PPCStartSync(__A0)
  365. #endif
  366. extern pascal OSErr PPCStartSync(PPCStartPBPtr pb)
  367.  TWOWORDINLINE(0x7002, 0xA0DD);
  368.  
  369.  
  370. #if GENERATING68K && !GENERATINGCFM
  371. #pragma parameter __D0 PPCStartAsync(__A0)
  372. #endif
  373. extern pascal OSErr PPCStartAsync(PPCStartPBPtr pb)
  374.  TWOWORDINLINE(0x7002, 0xA4DD);
  375.  
  376.  
  377. #if GENERATING68K && !GENERATINGCFM
  378. #pragma parameter __D0 PPCAcceptSync(__A0)
  379. #endif
  380. extern pascal OSErr PPCAcceptSync(PPCAcceptPBPtr pb)
  381.  TWOWORDINLINE(0x7004, 0xA0DD);
  382.  
  383.  
  384. #if GENERATING68K && !GENERATINGCFM
  385. #pragma parameter __D0 PPCAcceptAsync(__A0)
  386. #endif
  387. extern pascal OSErr PPCAcceptAsync(PPCAcceptPBPtr pb)
  388.  TWOWORDINLINE(0x7004, 0xA4DD);
  389.  
  390.  
  391. #if GENERATING68K && !GENERATINGCFM
  392. #pragma parameter __D0 PPCRejectSync(__A0)
  393. #endif
  394. extern pascal OSErr PPCRejectSync(PPCRejectPBPtr pb)
  395.  TWOWORDINLINE(0x7005, 0xA0DD);
  396.  
  397.  
  398. #if GENERATING68K && !GENERATINGCFM
  399. #pragma parameter __D0 PPCRejectAsync(__A0)
  400. #endif
  401. extern pascal OSErr PPCRejectAsync(PPCRejectPBPtr pb)
  402.  TWOWORDINLINE(0x7005, 0xA4DD);
  403.  
  404.  
  405. #if GENERATING68K && !GENERATINGCFM
  406. #pragma parameter __D0 PPCWriteSync(__A0)
  407. #endif
  408. extern pascal OSErr PPCWriteSync(PPCWritePBPtr pb)
  409.  TWOWORDINLINE(0x7006, 0xA0DD);
  410.  
  411.  
  412. #if GENERATING68K && !GENERATINGCFM
  413. #pragma parameter __D0 PPCWriteAsync(__A0)
  414. #endif
  415. extern pascal OSErr PPCWriteAsync(PPCWritePBPtr pb)
  416.  TWOWORDINLINE(0x7006, 0xA4DD);
  417.  
  418.  
  419. #if GENERATING68K && !GENERATINGCFM
  420. #pragma parameter __D0 PPCReadSync(__A0)
  421. #endif
  422. extern pascal OSErr PPCReadSync(PPCReadPBPtr pb)
  423.  TWOWORDINLINE(0x7007, 0xA0DD);
  424.  
  425.  
  426. #if GENERATING68K && !GENERATINGCFM
  427. #pragma parameter __D0 PPCReadAsync(__A0)
  428. #endif
  429. extern pascal OSErr PPCReadAsync(PPCReadPBPtr pb)
  430.  TWOWORDINLINE(0x7007, 0xA4DD);
  431.  
  432.  
  433. #if GENERATING68K && !GENERATINGCFM
  434. #pragma parameter __D0 PPCEndSync(__A0)
  435. #endif
  436. extern pascal OSErr PPCEndSync(PPCEndPBPtr pb)
  437.  TWOWORDINLINE(0x7008, 0xA0DD);
  438.  
  439.  
  440. #if GENERATING68K && !GENERATINGCFM
  441. #pragma parameter __D0 PPCEndAsync(__A0)
  442. #endif
  443. extern pascal OSErr PPCEndAsync(PPCEndPBPtr pb)
  444.  TWOWORDINLINE(0x7008, 0xA4DD);
  445.  
  446.  
  447. #if GENERATING68K && !GENERATINGCFM
  448. #pragma parameter __D0 PPCCloseSync(__A0)
  449. #endif
  450. extern pascal OSErr PPCCloseSync(PPCClosePBPtr pb)
  451.  TWOWORDINLINE(0x7009, 0xA0DD);
  452.  
  453.  
  454. #if GENERATING68K && !GENERATINGCFM
  455. #pragma parameter __D0 PPCCloseAsync(__A0)
  456. #endif
  457. extern pascal OSErr PPCCloseAsync(PPCClosePBPtr pb)
  458.  TWOWORDINLINE(0x7009, 0xA4DD);
  459.  
  460.  
  461. #if GENERATING68K && !GENERATINGCFM
  462. #pragma parameter __D0 IPCListPortsSync(__A0)
  463. #endif
  464. extern pascal OSErr IPCListPortsSync(IPCListPortsPBPtr pb)
  465.  TWOWORDINLINE(0x700A, 0xA0DD);
  466.  
  467.  
  468. #if GENERATING68K && !GENERATINGCFM
  469. #pragma parameter __D0 IPCListPortsAsync(__A0)
  470. #endif
  471. extern pascal OSErr IPCListPortsAsync(IPCListPortsPBPtr pb)
  472.  TWOWORDINLINE(0x700A, 0xA4DD);
  473.  
  474. extern pascal OSErr DeleteUserIdentity(unsigned long userRef);
  475.  
  476. extern pascal OSErr GetDefaultUser(unsigned long *userRef, Str32 userName);
  477.  
  478. extern pascal OSErr StartSecureSession(PPCStartPBPtr pb, Str32 userName, Boolean useDefault, Boolean allowGuest, Boolean *guestSelected, ConstStr255Param prompt);
  479.  
  480. typedef pascal Boolean (*PPCFilterProcPtr)(LocationNamePtr name, PortInfoPtr port);
  481.  
  482. #if GENERATINGCFM
  483. typedef UniversalProcPtr PPCFilterUPP;
  484. #else
  485. typedef PPCFilterProcPtr PPCFilterUPP;
  486. #endif
  487.  
  488. enum {
  489.     uppPPCCompProcInfo = kPascalStackBased
  490.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(PPCParamBlockPtr))),
  491.     uppPPCFilterProcInfo = kPascalStackBased
  492.          | RESULT_SIZE(SIZE_CODE(sizeof(Boolean)))
  493.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(LocationNamePtr)))
  494.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(PortInfoPtr)))
  495. };
  496.  
  497. #if GENERATINGCFM
  498. #define NewPPCCompProc(userRoutine)        \
  499.         (PPCCompUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppPPCCompProcInfo, GetCurrentArchitecture())
  500. #define NewPPCFilterProc(userRoutine)        \
  501.         (PPCFilterUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppPPCFilterProcInfo, GetCurrentArchitecture())
  502. #else
  503. #define NewPPCCompProc(userRoutine)        \
  504.         ((PPCCompUPP) (userRoutine))
  505. #define NewPPCFilterProc(userRoutine)        \
  506.         ((PPCFilterUPP) (userRoutine))
  507. #endif
  508.  
  509. #if GENERATINGCFM
  510. #define CallPPCCompProc(userRoutine, pb)        \
  511.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppPPCCompProcInfo, (pb))
  512. #define CallPPCFilterProc(userRoutine, name, port)        \
  513.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppPPCFilterProcInfo, (name), (port))
  514. #else
  515. #define CallPPCCompProc(userRoutine, pb)        \
  516.         (*(userRoutine))((pb))
  517. #define CallPPCFilterProc(userRoutine, name, port)        \
  518.         (*(userRoutine))((name), (port))
  519. #endif
  520. extern pascal OSErr PPCBrowser(ConstStr255Param prompt, ConstStr255Param applListLabel, Boolean defaultSpecified, LocationNameRec *theLocation, PortInfoRec *thePortInfo, PPCFilterUPP portFilter, ConstStr32Param theLocNBPType)
  521.  THREEWORDINLINE(0x303C, 0x0D00, 0xA82B);
  522.  
  523. #if OLDROUTINENAMES
  524. /*
  525.   The ParamBlock calls with the "Sync" or "Async" suffix are being phased out.
  526. */
  527. #define PPCOpen(pb, async)      ((async) ? PPCOpenAsync(pb)      : PPCOpenSync(pb))
  528. #define PPCInform(pb, async)    ((async) ? PPCInformAsync(pb)    : PPCInformSync(pb))
  529. #define PPCStart(pb, async)     ((async) ? PPCStartAsync(pb)     : PPCStartSync(pb))
  530. #define PPCAccept(pb, async)    ((async) ? PPCAcceptAsync(pb)    : PPCAcceptSync(pb))
  531. #define PPCReject(pb, async)    ((async) ? PPCRejectAsync(pb)    : PPCRejectSync(pb))
  532. #define PPCWrite(pb, async)     ((async) ? PPCWriteAsync(pb)     : PPCWriteSync(pb))
  533. #define PPCRead(pb, async)      ((async) ? PPCReadAsync(pb)      : PPCReadSync(pb))
  534. #define PPCEnd(pb, async)       ((async) ? PPCEndAsync(pb)       : PPCEndSync(pb))
  535. #define PPCClose(pb, async)     ((async) ? PPCCloseAsync(pb)     : PPCCloseSync(pb))
  536. #define IPCListPorts(pb, async) ((async) ? IPCListPortsAsync(pb) : IPCListPortsSync(pb))
  537. #endif
  538. #endif
  539.  
  540. #if PRAGMA_ALIGN_SUPPORTED
  541. #pragma options align=reset
  542. #endif
  543.  
  544. #if PRAGMA_IMPORT_SUPPORTED
  545. #pragma import off
  546. #endif
  547.  
  548. #ifdef __cplusplus
  549. }
  550. #endif
  551.  
  552. #endif /* __PPCTOOLBOX__ */
  553.  
  554.